<template>
  <div class="left-1">
    <!-- 左侧一 -->
    <div class="text-1">学院点播排行</div>
    <!-- 写你的内容 -->
    <div v-for="(item, index) in arr" :key="index">
      <div class="text-2">
        <div class="ico">NO.{{ item.id }}</div>
        <div class="name">{{ item.content }}</div>
        <div class="sun">{{ item.cnt }}</div>
      </div>
      <!-- 进度条 -->
      <el-progress
        :percentage="item.percentage"
        class="pr-1"
        :stroke-width="3"
        :show-text="false"
      />
    </div>
  </div>
</template>

<script lang="ts" setup>
import { getVideoData } from '@/services/index'
import type { objs } from '@/types'
import { ref, onMounted } from 'vue'
const arr = ref<objs[]>([])
const arr1 = async () => {
  const res = await getVideoData()
  arr.value = res.data
  console.log(res)
}
onMounted(() => {
  arr1()
})
</script>

<style lang="scss" scoped>
.left-1 {
  width: 185px;
  height: 790px;
  margin: 0 10px;
  background-image: url('../assets/img/z-1.png');
  background-repeat: no-repeat;
  background-size: 100% 100%;

  padding: 10px;
  .text-1 {
    width: 160px;
    height: 40px;
    color: rgb(255, 255, 255);
    font-weight: bold;
    font-family: 'Microsoft Yahei', Arial, 'sans-serif';
    font-size: 22px;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
    line-height: 40px;
  }
  .pr-1 {
    margin-bottom: 3px;
  }
  .text-2 {
    width: 100%;
    display: flex;
    justify-content: space-around;
    margin-bottom: 5px;
    .ico {
      width: 53px;
      color: #1397ff;
      font-size: 10px;
      font-weight: normal;
    }
    .name {
      width: 73px;
      color: #fff;
      font-size: 12px;
    }
    .sun {
      width: 43px;
      color: #fff;
      font-size: 12px;
      text-align: center;
    }
  }
}
</style>
